<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>菜单管理</title>

    <!-- Bootstrap -->
    <link href="/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<form method="post" action="">
    <input type="hidden" name="_method" value="DELETE">
</form>

    <nav class="navbar"></nav>
    <div>

    </div>
<div class="container">
    <c:if test="${empty requestScope.menus}">
        <h1>没有数据</h1>
    </c:if>
    <c:if test="${!empty requestScope.menus}">
        <table>
            <tr>
                <td>菜单ID</td>
                <td>菜单名</td>
                <td>链接</td>
                <td>排序</td>
                <td>删除</td>
                <td>编辑</td>
            </tr>

            <c:forEach var="menu" items="${requestScope.menus}">
                <tr>
                    <td>${menu.id}</td>
                    <td>${menu.name}</td>
                    <td>${menu.url}</td>
                    <td>${menu.order}</td>
                    <td><a class="delete" href="/menu/${menu.id}">删除</a></td>
                    <td><a href="/menu/${menu.id}">编辑</a></td>
                </tr>
            </c:forEach>
        </table>
    </c:if>
    <a href="/menu">添加菜单</a>

</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="/js/jquery-3.1.0.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="/js/bootstrap.min.js"></script>
</body>
</html>
